﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace Snmp.Agent.DataLoader
{
    public class Loader
    {
       public void Write()
       {
           var v = new MibTable();
            var xmlSerializer = new XmlSerializer(v.GetType());
            TextWriter writer = new StreamWriter("output.xml");
            v.init();
            xmlSerializer.Serialize(writer, v);
        }

        public static MibTable Load(string fileName)
        {
            TextReader reader = new StreamReader(fileName);
            XmlSerializer serializer = new XmlSerializer(typeof(MibTable));
            return (MibTable) serializer.Deserialize(reader);
        }
    }
}
